#ifndef MODULES_COMMON_MACRO_H_
#define MODULES_COMMON_MACRO_H_

#include <iomanip>
#include <iostream>

#define CACHELINE_SIZE 64

#define MAKE_CONSTRUCTOR_DESTRUCTOR_DEFAULT(classname) \
  classname() = default;                               \
  ~classname() = default;

#define DISALLOW_COPY_AND_ASSIGN(classname) \
 private:                                   \
  classname(const classname&);              \
  classname& operator=(const classname&);

#define DECLARE_SINGLETON(classname)  \
 public:                              \
  static classname* Instance() {      \
    static classname instance;        \
    return &instance;                 \
  }                                   \
  DISALLOW_COPY_AND_ASSIGN(classname) \
 private:                             \
  classname();

#define DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(classname) \
 public:                                                 \
  static classname* Instance() {                         \
    static classname instance;                           \
    return &instance;                                    \
  }                                                      \
  DISALLOW_COPY_AND_ASSIGN(classname)

#endif  // MODULES_COMMON_MACRO_H_
